package com.atguigu.start.teststartmodule19.listener;

import org.springframework.boot.ConfigurableBootstrapContext;
import org.springframework.boot.SpringApplicationRunListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import java.time.Duration;

public class MyListener implements SpringApplicationRunListener {
    public void starting(ConfigurableBootstrapContext bootstrapContext) {
        System.out.println("☆☆☆MyListener.starting()☆☆☆");
    }

    public void environmentPrepared(ConfigurableBootstrapContext bootstrapContext, ConfigurableEnvironment environment) {
        System.out.println("☆☆☆MyListener.environmentPrepared()☆☆☆");
    }

    public void contextPrepared(ConfigurableApplicationContext context) {
        System.out.println("☆☆☆MyListener.contextPrepared()☆☆☆");
    }

    public void contextLoaded(ConfigurableApplicationContext context) {
        System.out.println("☆☆☆MyListener.contextLoaded()☆☆☆");
    }

    public void started(ConfigurableApplicationContext context, Duration timeTaken) {
        System.out.println("☆☆☆MyListener.started()☆☆☆");

    }

    public void ready(ConfigurableApplicationContext context, Duration timeTaken) {
        System.out.println("☆☆☆MyListener.ready()☆☆☆");
    }

    public void failed(ConfigurableApplicationContext context, Throwable exception) {
        System.out.println("☆☆☆MyListener.failed()☆☆☆");
    }
}
